package appapi.Vo.record;

import appapi.entity.record.MonthInspectionEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 请求对象
 *
 * @author luocheng
 * @version 1.0
 * @date 2023/06/01 13:45
 */
@ApiModel
@Data
public class EditMonthRecVo {
    @ApiModelProperty(value = "月检记录ID", required = true)
    private Long monthId;

    @ApiModelProperty(value = "设备ID",required = true)
    private Long equipId;

    /**
     * 设备名称
     */
    @ApiModelProperty(value = "设备名称",required = true)
    private String equipName;

    /**
     * 月检时间
     */
    @ApiModelProperty(value = "发证日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date monthDate;

    /**
     * 月检公司
     */
    @ApiModelProperty(value = "月检公司",required = true)
    private String monthCompany;

    /**
     * 月检人员
     */
    @ApiModelProperty(value = "月检人员",required = true)
    private String operator;

    /**
     * 月检人员
     */
    @ApiModelProperty(value = "月检修改人员",required = true)
    private String editOperator;

    /**
     * 0-正常;1-异常
     */
    @ApiModelProperty(value = "检测结果",required = true)
    private Integer monthResult;


    /**
     * 整改要求
     */
    @ApiModelProperty(value = "整改要求")
    private String expRequire;

    /**
     * 监检证书号
     */
    @ApiModelProperty(value = "监检证书号",required = true)
    private String certNumber;

    /**
     * 发证日期
     */
    @ApiModelProperty(value = "发证日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date issuDate;

    /**
     * 复审日期
     */
    @ApiModelProperty(value = "复审日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date reviewDate;

    /**
     * 操作人员
     */
    @ApiModelProperty(value = "管理人员ID",required = true)
    private Long staffId;

    /**
     * 创建人名称
     */
    @ApiModelProperty(value = "创建人名称")
    private String createUser;
    @ApiModelProperty(value = "附件地址url")
    private List<String> annexUrl;
    @ApiModelProperty(value = "月检明细",required = true)
    private List<EditMonthDetailVo> detailVos;

    public MonthInspectionEntity vo2Entity(){
        MonthInspectionEntity entity = new MonthInspectionEntity();
        BeanUtils.copyProperties(this,entity);
        return entity;
    }
}
